
sudo yum install -y dhcp

# 编辑配置文件
sudo vim /etc/dhcp/dhcpd.conf

subnet 192.168.75.0 netmask 255.255.255.0 {
  range 192.168.75.100 192.168.75.200;  # 动态IP范围
  option routers 192.168.75.1;          # 网关（VMnet1的IP，修改后应为192.168.75.1）
}


host pc-lichangsheng {
  hardware ethernet 00:50:56:C0:00:01;  # VMnet1的MAC地址
  fixed-address 192.168.75.32;          # 任务要求的固定IP
}

sudo systemctl start dhcpd
sudo systemctl enable dhcpd
sudo systemctl status dhcpd  # 确认状态为active (running)
